package dfbz.异常处理;

import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class demo01 {
    public static void main(String[] args) {
        FileWriter fileWriter=null;
        try {
             fileWriter=new FileWriter(new File("E:\\东方标准\\JAVASE阶段\\JAVASE-CODE\\Day18\\e.txt"),true);
            FileReader fileReader=new FileReader(new File("E:\\东方标准\\JAVASE阶段\\JAVASE-CODE\\Day18\\e.txt"));
//            fileWriter.write("wa爱lu");
            int len=0;
            char[] chars=new char[10];
            while ((len=fileReader.read(chars))!=-1){
                System.out.print(chars);
            }
            fileWriter.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
        try {
            if(fileWriter!=null){
                fileWriter.close();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
